package org.example.common.base.request;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.util.Map;

@Data
@ApiModel(description = "通用请求参数")
public class CommonRequestParam<T> {

    @ApiModelProperty(value = "仓库编码", required = true, example = "WH001")
    @NotBlank(message = "仓库编码不能为空")
    private String code;

    @ApiModelProperty(value = "API地址", required = true, example = "https://api.example.com")
    @NotBlank(message = "api地址码不能为空")
    private String sysUrl;

    @ApiModelProperty(value = "异步回调地址", example = "https://api.callback.com")
    private String notifyUrl;

    @ApiModelProperty(value = "请求授权信息", notes = "包含认证所需的键值对信息")
    private Map<String, String> authInfo;

    @ApiModelProperty(value = "请求体", required = true)
    @Valid
    private T body;
}

